home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 223_01 / reverse.c < prev    next >
Text File  |  1980-01-01  |  384b  |  17 lines

  1. #define NOCCARGC  /* no argument count passing */
  2. /*
  3. ** reverse string in place 
  4. */
  5.   static char *j;
  6.   static int c;
  7.  
  8. reverse(s) char *s; {
  9.   j = s + strlen(s) - 1;
  10.   while(s < j) {
  11.     c = *s;
  12.     *s++ = *j;
  13.     *j-- = c;
  14.     }
  15.   }
  16.  
  17.